knitr::opts_knit$set(root.dir = '../../../')
library(stringr)
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Load data
data <- read.table('report/promoter_upstream_downstream_10kb/adultBrain/intersect.FrontalCortexOC.bed.gz', sep = '\t', header = F)
v11.good <- is.na(str_match(data$V14, '[ATGC]'))
v11.strategy1 <- str_match(data$V14, '(.+),.+,.+,.+')
v12.good <- is.na(str_match(data$V15, '[ATGC]'))
v12.strategy1 <- str_match(data$V15, '(.+),.+,.+,.+')
strategy1 <- v11.strategy1
strategy1[v12.good, ] <- v12.strategy1[v12.good, ]
# strategy1 <- str_match(data$V12, '(.+),.+,.+,.+')
strategy1 <- strategy1[, 2]
class(strategy1) <- 'numeric'
data <- data.frame(strategy1 = strategy1, centisnp = data$V7, motif = data$V4, position = data$V2, strand = data$V6)
data <- unique(data)
motifs <- unique(data$motif)
Include all motifs
ggplot(data) + geom_point(aes(x = centisnp, y = strategy1)) +
geom_abline(slope = 1, intercept = 0, color = 'red') +
ggtitle('All motifs')

for (i in motifs){
data.sub <- data[data$motif == i, ]
cat('\n')
cat("#", paste('Motif', i), "\n")
# cat("\n")
print(ggplot(data.sub) + geom_point(aes(x = centisnp, y = strategy1)) +
geom_abline(slope = 1, intercept = 0, color = 'red'))
# cat("\n")
cat("\n")
}
Motif M01504

Motif M01532

Motif PBM0050

Motif M00338

Motif M00041

Motif M01251

Motif M01992

Motif PBM0114

Motif PBM0095

Motif MA0119.1

Motif M01196

Motif M00236

Motif M00799

Motif PBM0097

Motif MA0076.1

Motif M01990

Motif M01988

Motif M01986

Motif M01976

Motif M00615

Motif M01916

Motif M01057

Motif PBM0054

Motif M00740

Motif M00806

Motif M00193

Motif M00916

Motif M00513

Motif M00017

Motif M00179

Motif M00178

Motif M01863

Motif M01862

Motif M00981

Motif MA0018.2

Motif M01861

Motif M00917

Motif M00691

Motif M01054

Motif M00307

Motif M00942

Motif M01187

Motif M01186

Motif M01208

Motif M01243

Motif M01558

Motif M00163

Motif M00220

Motif M01938

Motif M00036

Motif M01820

Motif M01586

Motif M00113

Motif M00946

Motif M00944

Motif M00375

Motif M00039

Motif M00121

Motif M00187

Motif M01065

Motif M00305

Motif M01259

Motif M01200

Motif MA0088.1

Motif M00660

Motif M00796

Motif M00024

Motif M01306

Motif M00490

Motif PBM0200

Motif M00122

Motif M01793

Motif M01779

Motif M01768

Motif M00539

Motif PBM0013

Motif M00119

Motif M00371

Motif M00370

Motif M01742

Motif M00652

Motif MA0139.1

Motif M00687

Motif M00288

Motif M00279

Motif M00280

Motif MA0138.2

Motif M01256

Motif M01028

Motif M00325

Motif M00256

Motif M01827

Motif M00422

Motif M00171

Motif M00651

Motif M00303

Motif M00281

Motif M00424

Motif M00007

Motif M00210

Motif M01796

Motif M01971

Motif PBM0039

Motif PBM0187

Motif M00117

Motif M00040

Motif M01375
